package bookez.view.util;

import javax.faces.application.FacesMessage;

public class ProcessMessage {

	public static void processError( String clientId, String errorId , Object[] params )	{
		
		// Obtain the error message
		FacesMessage error = MessagesUtil.getMessage( errorId, params );
		error.setSeverity( FacesMessage.SEVERITY_ERROR );
		
		// Add error message to UI component
		FacesUtil.addErrorMessage( clientId, error );
		
	}//end method processError
	
	public static void processInfo( String clientId, String infoId, Object[] params ) {
		FacesMessage info = MessagesUtil.getMessage( infoId , params );
		info.setSeverity( FacesMessage.SEVERITY_INFO );
		
		FacesUtil.addInfoMessage( clientId, info );
	}//end method processInfo
	
}//end class ProcessMessage
